package com.tool.btn;

import com.tool.role.RoleData;
import com.tool.tcpimg.UIUtils;
import come.tool.JDialog.TiShiUtil;

import java.awt.*;
import java.awt.event.MouseEvent;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;

import org.come.Frame.OptionsJframe;
import org.come.Frame.PetSkillsJframe;
import org.come.Frame.SupportListJframe;
import org.come.Frame.ZhuFrame;
import org.come.action.petpaixu.PetpxJpanel;
import org.come.until.FormsManagement;
import org.come.until.Music;
import org.come.until.UserMessUntil;
import org.come.until.Util;

public class DeleteSkillBtn extends MoBanBtn {
    public DeleteSkillBtn(String iconpath, int type, String text) {
        super(iconpath, type, UIUtils.COLOR_BTNTEXT);
        this.setText(text);
        this.setFont(UIUtils.TEXT_FONT);
        this.setVerticalTextPosition(0);
        this.setHorizontalTextPosition(0);
    }

    public void chooseyes() {
    }

    public void chooseno() {
    }

    public void nochoose(MouseEvent e) {
        if (this.getText().equals("支援列表")) {
            RoleData roleData = RoleData.getRoleData();
            roleData.addHelpBb(roleData.getHelpBbId());
            SupportListJframe.getSupportListJframe().getSupportListJpanel().init(roleData.getHelpBbName(roleData.getHelpBb()));
            FormsManagement.showForm(62);
        } else {
            if (this.getText().equals("排序")) {
                if (!FormsManagement.getframe(125).isVisible()) {
                    FormsManagement.showForm(125);
                    PetpxJpanel.showStar();
                    Music.addyinxiao("打开窗口.mp3");
                } else {
                    FormsManagement.HideForm(125);
                    Music.addyinxiao("关闭窗口.mp3");
                }
            } else if (this.getText().equals("删除技能")) {
                if (Util.isCanBuyOrno()) {
                    return;
                }

                if (PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getPetskillNO() == 10) {
                    if (UserMessUntil.getChosePetMes().getBeastSkills() != null && !UserMessUntil.getChosePetMes().getBeastSkills().equals("")) {
                        if (!PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getPetskillID().equals("")) {
                            OptionsJframe.getOptionsJframe().getOptionsJpanel().showBox(TiShiUtil.DeleteSkill, 1, "#Y你确定要删除 #G" +
                                    UserMessUntil.getSkillId(PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getPetskillID()).getSkillname() + "#Y这个技能吗?");
                        } else {
                            ZhuFrame.getZhuJpanel().addPrompt2("请选择你要删除的召唤兽技能！！！");
                        }
                    } else {
                        ZhuFrame.getZhuJpanel().addPrompt2("这只召唤兽没有技能！！！");
                    }
                } else if (UserMessUntil.getChosePetMes().getPetSkills() != null && !UserMessUntil.getChosePetMes().getPetSkills().equals("")) {
                    if (!PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getPetskillID().equals("")
                            && UserMessUntil.getChosePetMes().getPetSkills().indexOf(PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getPetskillID()) != -1) {
                        OptionsJframe.getOptionsJframe().getOptionsJpanel().showBox(TiShiUtil.DeleteSkill, 2, "#Y你确定要删除 #G" +
                                UserMessUntil.getSkillId(PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getPetskillID()).getSkillname() + "#Y这个技能吗?");
                    } else {
                        ZhuFrame.getZhuJpanel().addPrompt2("请选择你要删除的召唤兽技能！！！");
                    }
                } else {
                    ZhuFrame.getZhuJpanel().addPrompt2("这只召唤兽没有技能！！！");
                }
            } else if ("删除启灵".equals(this.getText())) {
                if (Util.isCanBuyOrno()) {
                    return;
                }

                if (UserMessUntil.getChosePetMes().getPetQlSkills() != null && !"".equals(UserMessUntil.getChosePetMes().getPetQlSkills())) {
                    if (!"".equals(PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getPetskillID()) && UserMessUntil.getChosePetMes().getPetQlSkills().indexOf(PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getPetskillID()) != -1) {
                        OptionsJframe.getOptionsJframe().getOptionsJpanel().showBox(TiShiUtil.DeleteQlSkill, 2, "#Y你确定要删除 #G" + UserMessUntil.getSkillId(PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getPetskillID()).getSkillname() + "#Y这个启灵技能吗?");
                    } else {
                        ZhuFrame.getZhuJpanel().addPrompt2("请选择你要删除的召唤兽启灵技能！！！");
                    }
                } else {
                    ZhuFrame.getZhuJpanel().addPrompt2("这只召唤兽没有启灵技能！！！");
                }
            }
        }
    }
}
